/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-17 17:58:59
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-17 17:59:52
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/utills/color_utils.dart';
import 'package:toggle_switch/toggle_switch.dart';

class WristbandMenu extends StatelessWidget {
  const WristbandMenu({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) => Row(
        children: [
          Text(
            "全校",
            style: TextStyle(
              fontSize: 16,
              fontWeight: FontWeight.w500,
            ),
          ),
          Spacer(),
          Container(
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(20),
              boxShadow: [
                BoxShadow(
                  offset: Offset(0, 0),
                  blurRadius: 20,
                  color: Color.fromRGBO(0, 0, 0, 0.05),
                ),
              ],
            ),
            child: ToggleSwitch(
              minWidth: 81.0,
              cornerRadius: 20.0,
              activeBgColors: [
                [gColor("#010101")],
                [gColor("#010101")]
              ],
              activeFgColor: Colors.white,
              inactiveBgColor: Colors.white,
              inactiveFgColor: Colors.black,
              initialLabelIndex: 1,
              totalSwitches: 2,
              labels: ['设备', '分布'],
              radiusStyle: true,
              onToggle: (index) {
                print('switched to: $index');
              },
            ),
          ),
          Spacer(),
          IconButton(
            onPressed: () {},
            icon: Icon(
              Icons.search,
            ),
          )
        ],
      );
}
